package com.gpzx.zx.module.home.ui.activity

import android.content.Context
import android.content.Intent
import android.os.Bundle
import com.wkq.base.frame.activity.MvpBindingActivity
import com.gpzx.zx.R
import com.gpzx.zx.databinding.ActivityChapterListBinding
import com.gpzx.zx.databinding.ActivityHomeNewsListBinding
import com.gpzx.zx.module.home.frame.presenter.HomeNewsListPresenter
import com.gpzx.zx.module.home.frame.view.HomeNewsListView

/**
 *
 * 作者:吴奎庆
 *
 * 时间:2020/6/8
 *
 * 用途:
 */


class HomeNewsListActivity : MvpBindingActivity<HomeNewsListView, HomeNewsListPresenter, ActivityHomeNewsListBinding>() {
    var title: String? = ""

    companion object {
        fun newInstance(context: Context) {
            var intnet = Intent(context, HomeNewsListActivity().javaClass)
            context.startActivity(intnet)
        }

        fun newInstance(context: Context, title: String) {
            var intnet = Intent(context, HomeNewsListActivity().javaClass)
            intnet.putExtra("title", title)
            context.startActivity(intnet)
        }
    }

    override fun getLayoutId(): Int {
        return R.layout.activity_home_news_list
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        title = intent.getStringExtra("title")
        if (mvpView != null) mvpView.initView(title!!)
    }

    override fun onResume() {
        super.onResume()
        if (presenter != null) presenter.initData(this,title)
//        if (TextUtils.isEmpty(type)) {
//
//        } else {
//            if (presenter != null) presenter.initDataType(this, type)
//        }
    }
}